package cn.itcast.web;

import cn.itcast.pojo.vo.RespBean;
import cn.itcast.service.NoticeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/wxshop/notice")
public class NoticeController {

    @Resource
    private NoticeService noticeService;

    @ApiOperation("获取最新的一条公告")
    @GetMapping("getOne")
    public RespBean getOneNotice(){
        return RespBean.success(null,noticeService.getNoticeNewest());
    }

}
